def repeat(list1,list2):
    result = []
    while list1 and list2:
        if list1[0][1]<list2[0][0]:
            list1.pop(0)
        elif list1[0][0]>list2[0][1]:
            list2.pop(0)
        else:
            a=max(list1[0][0],list2[0][0])
            b=min(list1[0][1],list2[0][1])
            result.append([a,b])
            if list1[0][1]>list2[0][1]:
                list2.pop(0)
            else:
                list1.pop(0)
    return result



list1=[[0,2],[5,10],[13,23],[24,25]]
list2=[[1,5],[8,12],[15,24],[25,26]]
print(repeat(list1,list2))